package com.be.beadmin.product.entity;

import com.be.beadmin.common.entity.BaseEntity;
import lombok.Data;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.math.BigDecimal;
import java.util.Date;

/**
 * @Description: 单柜/工单信息
 * @author: Jiaming Zheng
 * @Date: Create in 15:48 2023/3/19
 * @Modified By:
 **/

@Entity
@Table(name="T_OM_WorkOrderInfor")
@Getter
@Setter
@ToString
public class WorkOrderInfor extends BaseEntity {

    @Column(name = "Wo",columnDefinition = "VARCHAR(50) COMMENT '工单号'")
    private String wo;

    @Column(name = "WoDesc",columnDefinition = "VARCHAR(200) COMMENT '工单描述'")
    private String woDesc;

    @Column(name = "InfoId",columnDefinition = "VARCHAR(50) COMMENT '项目id' ")
    private String infoId;
    @Column(name = "ProductName",columnDefinition = "VARCHAR(50) COMMENT '柜体名称' ")
    private String productName;
    @Column(name = "ProjectCode",columnDefinition = "VARCHAR(50) COMMENT '项目编码' ")
    private String projectCode;

    @Column(name = "ProjectName",columnDefinition = "VARCHAR(50) COMMENT '项目名称' ")
    private String projectName;

    @Column(name = "CurrentBatch",columnDefinition = "int COMMENT '当前批次' ")
    private Integer currentBatch;

    @Column(name = "BatchCount",columnDefinition = "int COMMENT '批次总数' ")
    private Integer batchCount;

    @Column(name = "ProductType", columnDefinition = "VARCHAR(50) COMMENT '柜体类型' ")
    private String productType;

    @Column(name = "ErpMo", columnDefinition = "VARCHAR(50) COMMENT 'erp订单号' ")
    private String erpMo;

    /**
     * 0 - 不齐套
     * 1 - 齐套
     */
    @Column(name = "IsFileKitting", columnDefinition = "int COMMENT '技术文件是否齐套' ")
    private Integer isFileKitting;
    @Column(name = "BatchPlanId", columnDefinition = "VARCHAR(50) COMMENT '计划Id' ")
    private String batchPlanId;

    @Column(name = "BatchPlanCode", columnDefinition = "VARCHAR(50) COMMENT '计划编码' ")
    private String batchPlanCode;

    @Column(name = "BatchProductId",columnDefinition = "VARCHAR(50) COMMENT '柜体ID'")
    private String batchProductId;

    @Column(name = "BatchProductCode",columnDefinition = "VARCHAR(50) COMMENT '柜体编号'")
    private String batchProductCode;

    @Column(name = "ProductSequence",columnDefinition = "VARCHAR(50) COMMENT '柜体序号'")
    private String productSequence;

    @Column(name = "ProductDesc",columnDefinition = "VARCHAR(50) COMMENT '柜体描述'")
    private String productDesc;

    @Column(
            name = "PlanEditFlag",
            nullable = false,
            columnDefinition = "decimal(1) default 0 COMMENT '工单计划调整标识' "
    )
    protected Integer planEditFlag = 0;
    /**
     * 0 - 未释放
     * 1 - 已释放
     */
    @Column(
            name = "ReleaseFlag",
            nullable = false,
            columnDefinition = "decimal(1) default 0 COMMENT '工单计划释放标识' "
    )
    protected Integer releaseFlag = 0;
    /**
     * 0 未开始
     * 1 执行中
     * 2 已结束
     */
    @Column(
            name = "state",
            nullable = false,
            columnDefinition = "decimal(1) default 0 COMMENT '工单状态' "
    )
    private Integer state = 0;

    /**
     * 0 未开始
     * 1 执行中
     * 2 已结束
     * 3 未按计划开始  预警
     * 4 未按计划结束  超期
     */
    @Column(
            name = "AlertStatus",
            nullable = false,
            columnDefinition = "int default 0 COMMENT '当前工单执行状态' "
    )
    protected Integer alertStatus = 0;



    @Column(name = "ReleaseTime",columnDefinition = "datetime COMMENT '柜体工单释放时间' ")
    private Date releaseTime;
    @Column(name = "closeTime",columnDefinition = "datetime COMMENT '柜体工单结束时间' ")
    private Date closeTime;


    @Column(name = "BatchDeliveryDate",columnDefinition = "datetime COMMENT '交付日期' ")
    private Date batchDeliveryDate;

    @Column(name = "ReleaseMan",columnDefinition = "VARCHAR(50) COMMENT '柜体工单释放人员' ")
    private String releaseMan;


    /**
     * 0 - 未排程
     * 1 - 自动排程
     * 2 - 手动排程
     */
    @Column(
            name = "ScheduledFlag",
            nullable = false,
            columnDefinition = "decimal(1) default 0 COMMENT '柜体工单排程状态' "
    )
    protected Integer scheduledFlag = 0;

    @Column(
            name = "ChangeStatus",
            nullable = false,
            columnDefinition = "decimal(1) default 0 COMMENT '变更状态' "
    )
    protected Integer changeStatus = 0;

    @Column(name = "Memo", columnDefinition = "VARCHAR(50) COMMENT '备注' ")
    private String memo;

    @Column(name = "NumPercent",columnDefinition = "decimal(5,4) default 0 COMMENT '数量齐套率'")
    private BigDecimal numPercent = BigDecimal.ZERO;

    @Column(name = "TypePercent",columnDefinition = "decimal(5,4) default 0 COMMENT '种类齐套率'")
    private BigDecimal typePercent = BigDecimal.ZERO;

}
